<template>
  <div >
    <MyHeader></MyHeader>
    <!-- 路由组件出口的地方 -->
    <router-view></router-view>
    <!-- 在home search 显示  在登陆 注册隐藏 -->
     <!-- <MyFooter v-show="$route.path=='/home' || $route.path=='/search'"></MyFooter> -->
     <MyFooter v-show="$route.meta.show"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/Header/MyHeader.vue"
import MyFooter from "./components/Footer/MyFooter.vue"


export default {
  name: 'App',
  components: {
    MyHeader,
    MyFooter,
  },
  mounted(){
    // 派发一action 获取商品分类
    this.$store.dispatch("home/categoryList");
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
